package org.example.cofinguration;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConfiguration {
    @Bean
    public DirectExchange directExchange() {
        return new DirectExchange("DirectExchange");
    }

    @Bean
    public Queue directQueue() {
        return new Queue("DirectQueue");
    }

    @Bean
    public Binding DirectBinding() {
        return BindingBuilder.bind(directQueue()).to(directExchange()).with("red");
    }
}

